#include "gl_util.h"

void pushMatrixTranslated(GLdouble x, GLdouble y, GLdouble z, GLenum texture) {
    glMatrixMode(GL_TEXTURE);
    glActiveTexture(texture);
    glPushMatrix();
    glTranslated(x, y, z);
    
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glTranslated(x, y, z);
}

void pushMatrixRotated(GLdouble theta, GLdouble x, GLdouble y, GLdouble z, GLenum texture) {
    glMatrixMode(GL_TEXTURE);
    glActiveTexture(texture);
    glPushMatrix();
    glRotated(theta, x, y, z);
    
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glRotated(theta, x, y, z);
}

void popMatrix(GLenum texture) {
    glMatrixMode(GL_TEXTURE);
    glActiveTexture(texture);
    glPopMatrix();

    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();
}
